
var vm = new Vue({
    el : "#DdxbkSjList",
    data : {
    },
    init:function(){
        var _self = this;
        layui.use(['layer'], function(){
            layer = layui.layer;
        });
    },
    methods: {

        saveRfidLists: function(){
            var _self =this;
            var leftcode = document.getElementById("leftsjCode").value;   //作业工单RFID
            var rightcode = document.getElementById("rightsjCode").value;   //作业工单RFID
           // var qtys = document.getElementById("qtys").value;   //上架数量

            if(leftcode == null || leftcode == ""){
                this.vueAlert("左脚RFID不能为空！");
                return;
            }
            if(rightcode == null || rightcode == ""){
                this.vueAlert("右脚RFID不能为空！");
                return;
            }
            var data ={
                leftcode : leftcode,
                rightcode : rightcode
            };
            _self.$nextTick(function() {
                _self.$http.post(host +"ddxbkSjList/saveXbkSjListByCode",data,{emulateJSON: true}).then(function(res){
                    if(res.ok){
                        _self.LeftxbkSjListData = res.body.LeftxbkSjListByCode;
                        _self.RightxbkSjListData = res.body.RightxbkSjListByCode;
                        _self.matching = res.body.matching;
                        _self.message = res.body.message;
                        _self.result = res.body.result;
                        if(_self.LeftxbkSjListData == "false"){
                            _self.vueAlert("左脚RFID不存在！");
                            return;
                        }else if(_self.RightxbkSjListData == "false"){
                            _self.vueAlert("右脚RFID不存在！");
                            return;
                        }else if(_self.matching == "false"){
                            _self.vueAlert("左右脚不匹配！");
                            return;
                        }else if(_self.result  == "false"){
                            _self.vueAlert("上架失败！");
                            return;
                        }else{
                            _self.vueAlert("上架成功！");
                            window.setTimeout(function() {
                                window.location.reload();
                            }, 1000);
                            return;
                        }
                    }
                });
            });
        },
        reset:function(data){
            window.location.reload();
        },
        vueAlert:function(msg){
            layui.use(['form'], function(){
                var layer = layui.layer;
                layer.msg(msg,{icon:6,time:2000});
            });
        }//,
        /*renderTable: function(_self,data){
            layui.use(['form','table','laydate'], function(){
                _self.table = layui.table;
                var form = layui.form;

                _self.table.render({
                    elem: '#xbkSjListTable',
                    width: 'full-20',
                    height: 'full-150',
                    cols: [[ //标题栏
                        { field: 'OPT_CODE', title: '工单号',width: 200},
                        {field: 'PRODUCTNAME', title: '型体',width: 200, align:'center' },
                        {field: 'OPT_MODE', title: '状态', minWidth: 80,align:'center'},
                        {field: 'UPDATED', title: '上架时间', minWidth: 160,align:'center',templet: "<div>{{layui.util.toDateString(d.EXE_DATE_FROM, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
                        {field: 'DESCRIPTION', title: '操作提示', minWidth: 160,align:'center',templet: "<div>{{layui.util.toDateString(d.EXE_DATE_TO, 'yyyy-MM-dd HH:mm:ss')}}</div>"}
                    ]],
                    data:data,
                    page: true, //是否显示分页
                    limits: [10, 20, 50],
                    limit: 15 //每页默认显示的数量
                });
            });
        }*/
    }
});